﻿<phone:PhoneApplicationPage
    x:Class="ChinaUnicom.Views.ClientInfoPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:avatar="clr-namespace:Avatar.Controls;assembly=avatar.wp"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"    
    mc:Ignorable="d"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    toolkit:TiltEffect.IsTiltEnabled="True" d:DesignHeight="728" d:DesignWidth="480">

    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:SlideTransition Mode="SlideLeftFadeIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:SlideTransition Mode="SlideLeftFadeIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:SlideTransition Mode="SlideLeftFadeOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:SlideTransition Mode="SlideLeftFadeOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent">

        <Grid.Resources>
            <Style x:Key="ProgressBarStyle" TargetType="ProgressBar">
                <Setter Property="Grid.Row" Value="0"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="Foreground" Value="White"/>
            </Style>
        </Grid.Resources>

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <Rectangle Style="{StaticResource PageTopRectangleStyle}"/>
            <Border Style="{StaticResource PageTopBorderStyle}">
                <TextBlock Text="联通助手" Style="{StaticResource PageTopTextStyle}"/>
            </Border>
        </StackPanel>
        <!--Pivot Control-->
        <controls:Pivot Grid.Row="1">
            <!--Pivot item one-->
            <controls:PivotItem Header="我的信息">
                <avatar:PullList ItemsSource="{Binding ClientItems}" 
                                 Visibility="{Binding FeeContentVisibility}"
                                 Pulled="OnClientPulled"
                                 Released="OnClientReleased"
                                 ItemTemplate="{StaticResource BasicTextTemplate}"
                                 Margin="12, 0, 12, 0">
                    <avatar:PullList.PullPanel>
                        <StackPanel>
                            <TextBlock Text="{Binding ClientPullrefresh}" Style="{StaticResource PulledTextStyle}"/>
                        </StackPanel>
                    </avatar:PullList.PullPanel>
                </avatar:PullList>
            </controls:PivotItem>

            <!--Pivot item two-->
            <controls:PivotItem Header="产品套餐">
                <ScrollViewer>
                    <StackPanel>
                        <StackPanel Margin="12 10">
                            <TextBlock Text="产品名称" FontSize="30"/>
                            <TextBlock Text="{Binding Product.Name}" Foreground="{StaticResource PhoneAccentBrush}"/>
                        </StackPanel>
                        <StackPanel Margin="12 10">
                            <TextBlock Text="生效时间" FontSize="30"/>
                            <TextBlock Text="{Binding Product.Started, Converter={StaticResource dateConverter}}" Foreground="{StaticResource PhoneAccentBrush}"/>
                        </StackPanel>
                        <StackPanel Margin="12 10">
                            <TextBlock Text="失效时间" FontSize="30"/>
                            <TextBlock Text="{Binding Product.Ended, Converter={StaticResource dateConverter}}" Foreground="{StaticResource PhoneAccentBrush}"/>
                        </StackPanel>
                        <StackPanel Margin="12 10">
                            <TextBlock Text="产品描述" FontSize="30"/>
                            <RichTextBox Margin="-10 0">
                                <Paragraph>
                                    <Run Text="{Binding Product.Description}" Foreground="{StaticResource PhoneSubtleBrush}"/>
                                </Paragraph>
                            </RichTextBox>
                        </StackPanel>
                    </StackPanel>
                </ScrollViewer>
            </controls:PivotItem>
        </controls:Pivot>

        <ProgressBar IsEnabled="{Binding ClientProgressEnabled}" 
                     IsIndeterminate="{Binding ClientProgressEnabled}" 
                     Visibility="{Binding ClientProgressEnabled, Converter={StaticResource booleanVisibilityConverter}}" 
                     Style="{StaticResource ProgressBarStyle}"/>

        <ProgressBar IsEnabled="{Binding PointProgressEnabled}" 
                     IsIndeterminate="{Binding PointProgressEnabled}" 
                     Visibility="{Binding PointProgressEnabled, Converter={StaticResource booleanVisibilityConverter}}" 
                     Style="{StaticResource ProgressBarStyle}"/>
    </Grid>

    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Themes/Images/back.png" Text="返回" Click="OnBackClick" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>